<?php

require_once 'MainPageWidget.php';
class TextWidget extends MainPageWidget {
	public $title = 'Текстовое объявление';
  public $text = '';
  public $widget_view = 'WG_NodeTextWidget';
  public $ui_settingsjs = "widget/hp/plaintext.js"; // кнопки в меню настроек виджета

	public function Render() {
    $content['text'] = $this->getParam("text");
		$content['title'] = $this->getParam("title");
    
		$this->content = $content;

		return $this;
  }
  
  public function settingsForm() {
		if ( !isset($this->params) || !isset($this->params['title']) ) {
			$this->params['title'] = $this->title;
		}
		
		//return $this->params;
	}
  
  public function setParams( $params ) {
    foreach ( $params as $key=>$val ) {
      if ( isset($this->$key) ) {
        $this->$key = $val;
      }
    }
  }
}